Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(onbaording): implement basic functions for the new onboarding #17003

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

jrainville
Copy link
Member

Fixes #16832

Implements all the needed basic Nim functions for the new onboarding.

They do no do anything just yet. They shall be integrated in another PR.

Everything compiles nonetheless.

@jrainville jrainville requested review from micieslak, caybro, alexjba and a team as code owners December 20, 2024 19:10
@jrainville jrainville changed the title feat(onbaording): implement basic function for the new onboarding feat(onbaording): implement basic functions for the new onboarding Dec 20, 2024
@status-im-auto
Copy link
Member

status-im-auto commented Dec 20, 2024

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ a54d864 #1 2024-12-20 19:16:55 ~6 min macos/aarch64 🍎dmg
✔️ a54d864 #1 2024-12-20 19:18:44 ~8 min tests/nim 📄log
✔️ a54d864 #1 2024-12-20 19:23:12 ~12 min tests/ui 📄log
✔️ a54d864 #1 2024-12-20 19:27:05 ~16 min macos/x86_64 🍎dmg
✔️ a54d864 #1 2024-12-20 19:28:58 ~18 min linux-nix/x86_64 📦tgz
✔️ a54d864 #1 2024-12-20 19:30:50 ~20 min linux/x86_64 📦tgz
✔️ a54d864 #1 2024-12-20 19:33:34 ~23 min windows/x86_64 💿exe
✔️ a0438a9 #2 2025-01-06 15:58:52 ~5 min macos/aarch64 🍎dmg
✔️ a0438a9 #2 2025-01-06 16:00:45 ~7 min tests/nim 📄log
✔️ a0438a9 #2 2025-01-06 16:05:34 ~11 min tests/ui 📄log
✔️ a0438a9 #2 2025-01-06 16:10:04 ~16 min macos/x86_64 🍎dmg
✔️ a0438a9 #2 2025-01-06 16:12:09 ~18 min linux-nix/x86_64 📦tgz
✔️ a0438a9 #2 2025-01-06 16:15:35 ~21 min windows/x86_64 💿exe
✔️ a0438a9 #2 2025-01-06 16:16:13 ~22 min linux/x86_64 📦tgz

Copy link
Member

@caybro caybro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall

src/app/modules/onboarding/controller.nim Show resolved Hide resolved
src/app/modules/onboarding/controller.nim Show resolved Hide resolved
CreateProfileWithKeycardExistingSeedphrase,
LoginWithSeedphrase,
LoginWithSyncing,
LoginWithKeycard
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My idea was to use the C++ enum here as the only source of truth (which I created in the other PR which is not merged yet ofc), and also in QML. Perhaps later :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah. I didn't find an enum that was usable, so I created one, but I have nothing against getting rid of this one to share the same you have once I integrate.
Do you know how to access the enum from Nim?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know how to access the enum from Nim?

Not exactly but with my slightly limited NIM knowledge, it should be possible 😆

src/app/modules/onboarding/view.nim Outdated Show resolved Hide resolved
Fixes #16832

Implements all the needed basic Nim functions for the new onboarding.

They do no do anything just yet. They shall be integrated in another commit.
@jrainville jrainville force-pushed the feat/new-onboarding-middle-layer-impl branch from a54d864 to a0438a9 Compare January 6, 2025 15:53
Copy link
Member

@caybro caybro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@glitchminer glitchminer self-requested a review January 7, 2025 14:49
@jrainville jrainville merged commit 13cdaa6 into master Jan 7, 2025
9 checks passed
@jrainville jrainville deleted the feat/new-onboarding-middle-layer-impl branch January 7, 2025 14:53
Copy link
Contributor

@igor-sirotin igor-sirotin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I'm late to the party

@@ -46,6 +46,6 @@ QtObject {
}

function inputConnectionStringForBootstrapping(connectionString) {
return root.devicesModule.inputConnectionStringForBootstrapping(connectionString)
root.devicesModule.inputConnectionStringForBootstrapping(connectionString)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it ok that it doesn't return the value anymore? Not sure if it was ever used, but it affects current behaviour.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iirc, we never used it in the QML at all, that's why I felt comfortable to remove it

Comment on lines +18 to +21
type PrimaryFlow* {.pure} = enum
Unknown = 0,
CreateProfile,
Login
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Soo, do we need PrimaryFlow, if all of the values in SecondaryFlow have prefix indicating the primary flow? Looks absolutely redundant 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe not indeed. I still didn't have access to the C++ enum, so now that I'm rebased on top of it, maybe we can simplify some more

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like you're right. The QML only provides the secondary flow, which is sufficient anyway:

!!! ONBOARDING FINISHED; flow: 1 ; data: {\"password\":\"1234567890\",\"keycardPin\":\"\",\"seedphrase\":\"\",\"enableBiometrics\":false}

I'll get rid of the primary flow complexity

method inputConnectionStringForBootstrapping*[T](self: Module[T], connectionString: string) =
self.controller.inputConnectionStringForBootstrapping(connectionString)

method finishOnboardingFlow*[T](self: Module[T], primaryFlowInt, secondaryFlowInt: int, dataJson: string): string =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I like the simplicity 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Onboarding] Create new Onboarding NIM backend
5 participants